/*
 * Vector3D.h
 *
 *  Created on: 18/05/2010
 *      Author: Jorge Antonio García Galicia
 */

#ifndef VECTOR3D_H_
#define VECTOR3D_H_
#include <iostream>
using namespace std;

namespace geometry {
class Vector3D {
private:
	float x, y, z;
	float lenght;

public:
	Vector3D();
	Vector3D(float, float, float);
	Vector3D(const float[]);
	virtual ~Vector3D();
	void normalize();
	float getX() const;
	float getY() const;
	float getZ() const;
	float* get() const;
	float largo() const;
	bool operator== (const Vector3D& otro) const;
	bool operator< (const Vector3D& otro) const;
	bool operator> (const Vector3D& otro) const;
	bool operator<= (const Vector3D& otro) const;
	bool operator>= (const Vector3D& otro) const;
	const Vector3D operator+ (const Vector3D& otro) const;
	const Vector3D operator- (const Vector3D& otro) const;
	const Vector3D operator% (const Vector3D& otro) const;
	float operator* (const Vector3D& otro) const;
	void  operator+= (const Vector3D& otro);
	void  operator-= (const Vector3D& otro);
    const Vector3D operator- () const;
    friend const Vector3D operator* (const float s, const Vector3D& v);
    friend const Vector3D operator* (const Vector3D& v, const float s);
    friend ostream& operator<< (ostream &os, const Vector3D &v);
    const Vector3D parteNormal(const Vector3D &n) const;
    const Vector3D parteTangencial(const Vector3D &n) const;
};
}

#endif /* VECTOR3D_H_ */
